package io.g740.service;

import io.g740.dto.FieldMappingDto;
import io.g740.dto.TableInfoDto;
import io.g740.enums.DataMigrationType;

import java.util.List;

/**
 * 迁移配置
 *
 * @author YunKaiLuo
 * @date 2024/10/21
 */
public class MigrationConfig {
    /**
     * 默认迁移所有字段
     * 所有在源表的字段都会迁移，
     * 因为没有对应配置，
     * 那么目标表中的字段会直接抄源表的字段
     */
    private boolean defaultMigrationOfAllFields = false;
    /**
     * 源数据库信息
     */
    private TableInfoDto sourceTableInfo;
    /**
     * 目标数据库信息
     */
    private TableInfoDto targetTableInfo;
    /**
     * 目标表与源表的字段映射关系
     */
    private List<FieldMappingDto> fieldMappingDtos;
    /**
     * 迁移类型
     */
    private DataMigrationType type;
    public boolean isDefaultMigrationOfAllFields() {
        return defaultMigrationOfAllFields;
    }

    public void setDefaultMigrationOfAllFields(boolean defaultMigrationOfAllFields) {
        this.defaultMigrationOfAllFields = defaultMigrationOfAllFields;
    }

    public TableInfoDto getSourceTableInfo() {
        return sourceTableInfo;
    }

    public void setSourceTableInfo(TableInfoDto sourceTableInfo) {
        this.sourceTableInfo = sourceTableInfo;
    }

    public TableInfoDto getTargetTableInfo() {
        return targetTableInfo;
    }

    public void setTargetTableInfo(TableInfoDto targetTableInfo) {
        this.targetTableInfo = targetTableInfo;
    }

    public List<FieldMappingDto> getFieldMappingDtos() {
        return fieldMappingDtos;
    }

    public void setFieldMappingDtos(List<FieldMappingDto> fieldMappingDtos) {
        this.fieldMappingDtos = fieldMappingDtos;
    }

    public DataMigrationType getType() {
        return type;
    }

    public void setType(DataMigrationType type) {
        this.type = type;
    }
}
